import { rcaNumberFormat0, get_month_first, get_date} from './common.js'
import { dateFormat } from '@/util/date';
import { commonTableOption } from './common.js'
export const startDate = get_month_first(0);
export const endDate = get_date(0);
export const tableOption = {
  ...commonTableOption,
   height: '360px',
  column: [{
    type: 'date',
    label: '日期',
    searchSpan: 12,
    width: '150px',
    searchRange: true,
    search: true,
    searchValue: [startDate, endDate], 
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
    prop: 'tradeDate',
  }, {
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    width:'150px',
    search: true,
    cascaderItem: ['stationCode'],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dict',

  }, {
    type: 'select',
    label: '站点',
    prop: 'stationCode',
    width:'150px',
    search: true,
    props: {
      label: 'name',
      value: 'code'
    },
    dicFlag: false,
    dicUrl: `/support/swparamstation/dict/{{key}}`,
  }, 
  {
    label: 'BOM充值',
    children: [
      {
        label: 'ACC充值',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'bomMoneyAccAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'bomMoneyAccWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      },      
      {
        label: '平台充值',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'bomMoneyPlatAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'bomMoneyPlatWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      },
      {
        label: '差异',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'bomMoneyDiffAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'bomMoneyDiffWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      }
    ]
  },
  {
    label: 'TVM充值',
    children: [
      {
        label: 'ACC充值',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'tvmMoneyAccAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'tvmMoneyAccWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '银联',
            prop: 'tvmMoneyAccUnion',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      },      
      {
        label: '平台充值',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'tvmMoneyPlatAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'tvmMoneyPlatWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '银联',
            prop: 'tvmMoneyPlatUnion',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      },
      {
        label: '差异',
        children: [
          {
            type: 'input',
            width:'150px',
            label: '支付宝',
            prop: 'tvmMoneyDiffAlipy',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '微信',
            prop: 'tvmMoneyDiffWechat',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }, {
            type: 'input',
            width:'150px',
            label: '银联',
            prop: 'tvmMoneyDiffUnion',
            showSummary: true,
            precision: 7,
            formatter: (row, value, label, column) => {
              return rcaNumberFormat0(value,true)
            },
          }
        ]
      }
    ]
  },
  {
    type: 'input',
    label: '回复原因',
    width:'180px',
    prop: 'replyReason',
  }, 
  {
    type: 'date',
    label: '回复日期',
    searchSpan: 12,
    width: '150px',
    searchRange: true,
    search: true,
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
    prop: 'replyDate',
  }, 
  ]
}
